<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>7-h5新增自定义属性方法</title>
	</head>
	<body>
		<span data-uid='2' data-cid='3'>h5自定义属性</span>
		<script type="text/javascript">
			//获取元素对象
			var span = document.querySelector('span');
			//自定义属性都存在dataset中
			console.log(span.dataset);
			//DOMStringMap { uid → "2", cid → "3" }
			console.log('uid::'+span.dataset.uid);
			console.log('cid::'+span.dataset.cid);
		</script>
	</body>
</html>
